package com.smartfast4j.springboot.config.demo.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 将sFtpConfig.properties这个配置文件信息赋予给SFtpConfig这个javabean
 * 需要加这三个注解:
 * @Configuration
 * @PropertySource(value = “classpath:sFtpConfig.properties”)
 * @ConfigurationProperties(prefix = "sftp.server")
 * Created by gacl on 2017/11/17.
 */
@Configuration
@PropertySource(value = "classpath:sFtpConfig.properties")//指明配置文件路径
@ConfigurationProperties(prefix = "sftp.server")
public class SFtpConfig {

    private String ip;
    private String username;
    private String password;
    private String workingPath;
    private int port;
    private String domain;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getWorkingPath() {
        return workingPath;
    }

    public void setWorkingPath(String workingPath) {
        this.workingPath = workingPath;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    @Override
    public String toString() {
        return "SFtpConfig{" +
                "ip='" + ip + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", workingPath='" + workingPath + '\'' +
                ", port=" + port +
                ", domain='" + domain + '\'' +
                '}';
    }
}
